<template>
	<view class="myArticle">
		<view   class="list" v-for="item in dataList" :key="item._id" @click="toDetail(item._id)">
			<view class="left">{{item.title}}</view>			
			<view class="right"><text class="iconfont icon-a-10-you"></text></view>
		</view>

	</view>
</template>

<script>
	const db=uniCloud.database()
	export default {
		data() {
			return {
				dataList:[],

			};
		},
		methods:{
			toDetail(id){
				uni.navigateTo({
					url:`/pages/articleDetail/articleDetail?id=${id}`
				})
			}
		},
		onLoad() {
			db.collection('lxArticle').where('user_id==$cloudEnv_uid').get().then((res)=>{
				this.dataList=res.result.data
			})
		}
	}
</script>

<style lang="scss" scoped>
	.myArticle {
	
		background-color: #F8F9F9;
		.list{
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 20rpx 0;
			padding: 20rpx 30rpx;
			background-color: #FFFFFF;
		}
	}
</style>